import BaseApi from '../BaseApi';

const controller = "/marketing";

export default {
    /**
     * @description 条件获取月卡信息列表
     * @author LiuTing
     * @date 2021/7/22
     */
    getMonthCardInfoList(condition) {
        return this.requestPost(controller, "/getMonthCardInfoList", condition);
    },
    /**
     * @description 获取月卡停车点列表
     * @author LiuTing
     * @date 2021/07/29
     */
    getMonthCardParkInfo() {
        return this.requestPost(controller, "/getMonthCardParkInfo");
    },

    /**
     * @description 条件获取月卡购买列表
     * @author LiuTing
     * @date 2021/7/25
     */
    getMonthCardRecordList(condition) {
        return this.requestPost(controller, "/getMonthCardRecordList", condition);
    },
    /**
     * @description 月卡购买记录导表
     * @author LiuTing
     * @date 2021/09/24
     */
    exportChargeExcel(condition){
        return this.requestDownloadGet(controller, "/exportMonthCardExcel", condition);
    },
    /**
     * @description 获取月卡信息列表
     * @author LiuTing
     * @date 2021/7/24
     */
    getMonthCardList() {
        return this.requestPost(controller, "/getMonthCardList");
    },
    
    /**
     * @description 获取月卡配置信息列表
     * @author LiuTing
     * @date 2021/6/27
     */
    getMonthCardConfigInfoList(condition) {
        return this.requestPost(controller, "/getMonthCardConfigInfoList", condition);
    },

    /**
     * @description 增加月卡信息
     * @author LiuTing
     * @date 2021/7/21
     */
    addMonthCardInfo(condition) {
        return this.requestPost(controller, "/addMonthCardInfo", condition);
    },

    /**
     * @description 编辑月卡信息
     * @author LiuTing
     * @date 2021/7/22
     */
    updateMonthCardInfo(condition) {
        return this.requestPost(controller, "/updateMonthCardInfo", condition);
    },

    /**
     * @description 删除月卡信息
     * @author LiuTing
     * @date 2021/7/22
     */
    delMonthCard(condition) {
        let data = this.requestPostForJson(controller, "/delMonthCard", condition);
        return data;
    },

    /**
     * @description 删除月卡配置信息
     * @author LiuTing
     * @date 2021/7/24
     */
    delMonthCardConfig(condition) {
        return this.requestPostForJson(controller, "/delMonthCardConfig", condition);
    },

    /**
     * @description 增加月卡配置信息
     * @author LiuTing
     * @date 2021/7/23
     */
    addMonthCardConfigInfo(condition) {
        return this.requestPostForJson(controller, "/addMonthCardConfigInfo", condition);
    },

    /**
     * @description 启用或禁用月卡
     * @author LiuTing
     * @date 2021/09/06
     */
    enableMonthCard(condition){
        return this.requestPost(controller, "/enableMonthCard", condition);
    },

    /**
     * @description 获取月卡粒度
     * @author LiuTing
     * @date 2021/7/23
     */
    getMonthCardRange(condition) {
        return this.requestPost(controller, "/getMonthCardRange", condition);
    },

    requestPost(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPost(newUrl, condition);
    },

    requestDownloadGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestDownloadGet(newUrl, condition);
    },

    requestPostForJson(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPostForJson(newUrl, condition);
    },
}